import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:mokeng/utils/utils.dart';
import 'package:mokeng/widgets/widgets.dart';

import 'logic.dart';
import 'trade_tab1/view.dart';
import 'trade_tab2/view.dart';
import 'trade_tab3/view.dart';

class TradeView extends GetView<TradeController> {
  const TradeView({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        inputSearchWithCalender(),
        Row(
          children: [
            Expanded(
              child: buildTabBar(controller.tabTitles, controller.tabController),
            ),
            InkWell(
              onTap: () {
                // controller.onTapReleasePosts();
              },
              child: Image.asset(
                "assets/images/ic_release_posts.webp",
                width: 38.w,
                height: 38.w,
              ),
            ),
            12.vGap,
          ],
        ),
        Expanded(child: _buildPageView()),
      ],
    );
  }

  // 内容页
  Widget _buildPageView() {
    return TabBarView(
      controller: controller.tabController,
      children: [
        const TransView(),
        WtbView(),
        MatchView(),
      ],
    );
  }
}
